package com.wxzz.elearing.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wxzz.elearing.user.dto.EnterprisePermissionDto;
import com.wxzz.elearing.user.entity.AdminPermission;
import com.wxzz.elearning.common.vo.ReturnVO;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author
 * @since 2021-03-11
 */
public interface IAdminPermissionService extends IService<AdminPermission> {


    /**
     * 展示权限
     *
     * @return
     */
    ReturnVO<List<AdminPermission>> listAdminPermission(Long enterpriseId);

    /**
     * 展示所有企业权限
     *
     * @return
     */
    ReturnVO<List<AdminPermission>> listAllAdminPermission();

    /**
     * 给企业分配权限
     *
     * @return
     */
    ReturnVO saveEnterpriseAdminPermission(EnterprisePermissionDto enterprisePermissionDto);


    /**
     * token换取用户权限信息
     *
     * @param adminUserId
     * @return
     */
    ReturnVO<Set<AdminPermission>> getAdminUserPermission(Long adminUserId, Long enterpriseId);


    /**
     * 回显角色对应权限
     *
     * @param adminRoleId
     * @return
     */
    ReturnVO<Set<AdminPermission>> listAdminPermissionForRole(Long adminRoleId, Long enterpriseId);

    /**
     * 禁用权限
     *
     * @param adminPermissions
     * @param disabledIds
     */
    void removePermissions(List<AdminPermission> adminPermissions, List<Long> disabledIds);

}
